package io.xxx.xbutler.web.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.xxx.xbutler.domain.ExportTask;
import io.xxx.xbutler.service.ExportTaskService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/export/task")
public class ExportTaskController {

    @Resource
    private ExportTaskService exportTaskService;

    @GetMapping("/list")
    public Page<ExportTask> list(ExportTask exportTask,
                                 @RequestParam(defaultValue = "1") Integer pageNumber,
                                 @RequestParam(defaultValue = "20") Integer pageSize) {
        return exportTaskService.list(exportTask, pageNumber, pageSize);
    }
}
